<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('在制品信息查询')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>wip时间：</label>
                            <input type="text" class="input-sm" id="timeFlag" name="timeFlag" readonly/>
                        </li>
                        <li>
                            <label>卡号：</label>
                            <input type="text" name="lotId"/>
                        </li>
                        <li>
                            <label>产品名称：</label>
                            <input type="text" name="partName"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="query()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="report:daystgmeswiplot:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped" style="white-space: nowrap;">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">

    var prefix = ctx + "report/daystgmeswiplot";
    var tableinit = true;

    var columns = [
        {
            field: 'NO',
            align : 'center',
            title: 'NO',
            formatter: function (value, row, index) {
                return $.table.serialNumber(index);
            }
        },
        {
            field: 'num1',
            align : 'center',
            title: '序号',
            visible: false
        },
        {
            field: 'timeFlag',
            align : 'center',
            title: '数据版本日期时间'
        },
        {
            field: 'lotId',
            align : 'center',
            title: '卡号'
        },
        {
            field: 'partName',
            align : 'center',
            title: '产品名称'
        },
        {
            field: 'partType',
            align : 'center',
            title: '产品类型'
        },
        {
            field: 'lotType',
            align : 'center',
            title: '批次类型'
        },
        {
            field: 'priority',
            align : 'center',
            title: '等级'
        },
        {
            field: 'mainQty',
            align : 'center',
            title: '片数'
        },
        {
            field: 'stageId',
            align : 'center',
            title: '工段号'
        },
        {
            field: 'stageDsc',
            align : 'center',
            title: '工段描述'
        },
        {
            field: 'stepName',
            align : 'center',
            title: '工步名称'
        },
        {
            field: 'stepDesc',
            align : 'center',
            title: '工步描述'
        },
        {
            field: 'contime',
            align : 'center',
            title: '停留时间/天'
        },
        {
            field: 'state',
            align : 'center',
            title: '当前状态'
        },
        {
            field: 'equipmentId',
            align : 'center',
            title: '设备ID'
        },
        {
            field: 'holdUser',
            align : 'center',
            title: 'HOLD人员'
        },
        {
            field: 'holdReason',
            align : 'center',
            title: '暂停备注'
        },
        {
            field: 'startTime',
            align : 'center',
            title: '批次开始时间'
        },
        {
            field: 'planEndDate',
            align : 'center',
            title: '计划完工日期'
        },
        {
            field: 'stepSeq',
            align : 'center',
            title: '工步序号'
        },
        {
            field: 'nextStep',
            align : 'center',
            title: '剩余工步'
        },
        {
            field: 'stepCount',
            align : 'center',
            title: '总工步'
        },
        {
            field: 'nextGkb',
            align : 'center',
            title: '剩余光刻数'
        },
        {
            field: 'countGkb',
            align : 'center',
            title: '总光刻数'
        }
    ];

    var options = {
        url: prefix + "/list",
        exportUrl: prefix + "/export",
        modalName: "在制品信息查询",
        showSearch: false,
        showRefresh: false,
        showToggle: false,
        showColumns: false,
        sidePagination: "client",
        pageList: [20, 30, 50],
        columns: columns
    };

    $(function() {
        layui.use('laydate', function(){
            layui.laydate.render({
                elem: '#timeFlag',
                type: 'date',
                min: '2022-06-25',
                max: new Date().toString(),
                format: 'yyyy-MM-dd'
            });

        });
    });

    function query() {
        if (tableinit) {
            $.table.init(options);
            tableinit = false;
        } else {
            $.table.search();
        }
    }
</script>
</body>
</html>